package zj.it.bhne.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import zj.it.bhne.greendao.entity.Books;
import zj.it.bhne.greendao.entity.Students;
import zj.it.bhne.greendao.entity.Teachers;

import zj.it.bhne.greendao.BooksDao;
import zj.it.bhne.greendao.StudentsDao;
import zj.it.bhne.greendao.TeachersDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig booksDaoConfig;
    private final DaoConfig studentsDaoConfig;
    private final DaoConfig teachersDaoConfig;

    private final BooksDao booksDao;
    private final StudentsDao studentsDao;
    private final TeachersDao teachersDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        booksDaoConfig = daoConfigMap.get(BooksDao.class).clone();
        booksDaoConfig.initIdentityScope(type);

        studentsDaoConfig = daoConfigMap.get(StudentsDao.class).clone();
        studentsDaoConfig.initIdentityScope(type);

        teachersDaoConfig = daoConfigMap.get(TeachersDao.class).clone();
        teachersDaoConfig.initIdentityScope(type);

        booksDao = new BooksDao(booksDaoConfig, this);
        studentsDao = new StudentsDao(studentsDaoConfig, this);
        teachersDao = new TeachersDao(teachersDaoConfig, this);

        registerDao(Books.class, booksDao);
        registerDao(Students.class, studentsDao);
        registerDao(Teachers.class, teachersDao);
    }
    
    public void clear() {
        booksDaoConfig.clearIdentityScope();
        studentsDaoConfig.clearIdentityScope();
        teachersDaoConfig.clearIdentityScope();
    }

    public BooksDao getBooksDao() {
        return booksDao;
    }

    public StudentsDao getStudentsDao() {
        return studentsDao;
    }

    public TeachersDao getTeachersDao() {
        return teachersDao;
    }

}
